<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="tag"%>

<s:set var="user_info" value="%{#session.USER_INFO}" />
<s:if test="%{#user_info == null}"><jsp:forward page="login.jsp"></jsp:forward></s:if>

<html>
    <head>
        <title>EPCS Calendar</title>
		<link href="css/bootstrap.css" rel="stylesheet" media="screen">
		<link href="css/bootstrap-theme.css" rel="stylesheet" media="screen">
		<link href="css/ace.min.css" rel="stylesheet" media="screen">
		<link href="css/font-awesome.min.css" rel="stylesheet"/>
		<link href="css/jquery.tagsinput.css" rel="stylesheet"/>
		<link href="css/trung-style.css" rel="stylesheet" media="screen">
		<link href='css/cupertino/jquery-ui.min.css' rel='stylesheet' />
		<link href='fullcalendar/fullcalendar.css' rel='stylesheet' />
		<link href='fullcalendar/fullcalendar.print.css' rel='stylesheet' media='print' />
		<link href="css/daterangepicker-bs3.css" rel="stylesheet" type="text/css" media="all"/>
		
		<script src="js/jquery.min.js"></script>
		<script src="js/jquery-1.9.0.min.js"></script>
		<script src="js/jquery.tagsinput.js"></script>
		<script src="js/bootstrap.js"></script>
		<script src="js/ace.min.js"></script>
		<script src="js/moment.js"></script>
		<script src="js/daterangepicker.js"></script>
		<script src='js/jquery-ui.custom.min.js'></script>
		<script src='fullcalendar/fullcalendar.min.js'></script>
		<script src='fullcalendar/lang/all.js'></script>
		<script src='fullcalendar/lang/vi.js'></script>
    </head>
	<body>
		
		<div class="index">
			<!--header -->
			<tag:HeaderTag username="${user_info.fullname}">
				
				<jsp:body>
				<div class="breadcrumbs" id="breadcrumbs" style="margin-bottom: 10px">
					<ul class="breadcrumb" style="margin: 8px;">
						<li>
							<i class="icon-home home-icon"></i>
							<a href="./Index.do">Trang chủ</a>
						</li>
						<li class="active">
							Quản lý sự kiện
						</li>
					</ul>
					<!-- .breadcrumb -->
				</div>
				</jsp:body>
			</tag:HeaderTag>
		
			
			<!--end header -->
			
			<!-- main body -->
			<tag:SideBarTag active_area="2"></tag:SideBarTag>
			
			
			<!-- Calendar board-->
			<!--End calendar board -->
			
			
			<!-- Modal -->
			<div class="main-content">			
			<div class="page-header">
				<h1>Quản lý sự kiện </h1>					
			</div>
			
			<div class="row boxContent">
				<div class="col-md-5 boxContent">
					<s:set var="working_event_list" value="%{#request.WORKING_EVENT_LIST}"></s:set>
					<div class="row" style="margin-bottom: 20px;">
					<span class="label label-success arrowed-right arrowed-in">
						Đang diễn ra
					</span>
					</div>
					<s:if test="%{#working_event_list != null}">
						<s:if test="%{#working_event_list.isEmpty() == false}">
						<s:iterator var="working_event_iter" value="%{#working_event_list}" status="count">		
																			
							<div class="row">
								<div class="row">
									<div class="col-md-12">
											<s:if test="%{#working_event_iter.organizer == null}">
												<div>
													<a href="PublicEventDetail.do?id=${working_event_iter.eventId} "
														style="text-decoration: none"> <span
														style="font-size: 16"><s:property
																	value="%{#working_event_iter.title}" /></span></a>
												</div>
											</s:if>
											<s:if test="%{#working_event_iter.organizer != null}">
												<div>
													<a href="PublicEventDetail.do?id=${working_event_iter.originalEvent.eventId} "
														style="text-decoration: none"> <span
														style="font-size: 16"><s:property
																	value="%{#working_event_iter.title}" /></span></a>
												</div>
											</s:if>

										</div>
								</div>
								<div class="row">
									<div class="col-md-12">
										<div style="font-size: 13px;">Còn&nbsp; ${working_event_iter.endTime}</div>
									</div>						
								</div>
								<div class="row"><div class="deliverLine"></div></div>
							</div>
						</s:iterator>
						</s:if>
						<s:else>
							<div class="row">Hiện tại không có sự kiện nào diễn ra!</div>
						</s:else>
					</s:if>
					<s:else>
						<div class="row">Hiện tại không có sự kiện nào diễn ra!</div>
					</s:else>
				</div>
				<div class="col-md-5 boxContent">
					<s:set var="future_event_list" value="%{#request.FUTURE_EVENT_LIST}"></s:set>
					<div class="row" style="margin-bottom: 20px;">
					<span class="label label-info  arrowed-right arrowed-in" >
						Sắp diễn ra 
					</span>	
					<!-- span class="badge">just now</span>	-->		
					</div>
					<s:if test="%{#future_event_list != null}">
					 	<s:if test="%{#future_event_list.isEmpty() == false}">
						<s:iterator var="future_event_iter" value="%{#future_event_list}" status="count">						
							<div class="row">
								<div class="row">
									<div class="col-md-12">
										<s:if test="%{#future_event_iter.organizer == null}">
												<div>
													<a href="PublicEventDetail.do?id=${future_event_iter.eventId} "
														style="text-decoration: none"> <span
														style="font-size: 16"><s:property
																	value="%{#future_event_iter.title}" /></span></a>
												</div>
											</s:if>
											<s:if test="%{#future_event_iter.organizer != null}">
												<div>
													<a href="PublicEventDetail.do?id=${future_event_iter.originalEvent.eventId} "
														style="text-decoration: none"> <span
														style="font-size: 16"><s:property
																	value="%{#future_event_iter.title}" /></span></a>
												</div>
											</s:if>
									</div>
								</div>
								<div class="row">
									<div class="col-md-12">
										<fmt:parseDate value="${future_event_iter.startTime}" pattern="yyyy-MM-dd'T'HH:mm:ssZ" var="start"/>								
										<div style="font-size: 13px;">Bắt đầu ngày&nbsp; 
											<fmt:formatDate value="${start}" pattern="dd/MM/yyyy (HH:mm)" />
										</div>
									</div>						
								</div>
								<div class="row"><div class="deliverLine"></div></div>
							</div>
						</s:iterator>
					 	</s:if>
					 	<s:else>
					 		<div class="row">Sắp tới không có sự kiện nào diễn ra!</div>
					 	</s:else>
					</s:if>
					<s:else>
						<div class="row">Sắp tới không có sự kiện nào diễn ra!</div>
					</s:else>
				</div>
				<a href="AllEvent.do" class="btn btn-link btn-sm">
					Xem tất cả sự kiện
				</a>				
			</div>			
			</div>
		</div>	
	</body>



</html>
